package demo01;

/**
 * @author: WangPeng
 * @createTime: 2022/10/25 16:51
 * @description:
 * @version: v1.0
 */
public class Demo01Test {
    public static void main(String[] args) {
        //坐标都是整型
        Point point1 = new Point(21,45);
        System.out.println("point1 = " + point1);
        //坐标都是小数
        Point point2 = new Point(12.1,11.4);
        System.out.println("point2 = " + point2);
        //坐标都是字符串
        Point point3 = new Point("东经120度","北纬25度");
        System.out.println("point3 = " + point3);
        //属性可以设置为字符串和整数----就不符合题目要求
        Point point4 = new Point("东经120度",12);
        System.out.println("point4 = " + point4);
        String x = (String) point4.getX();
        //java.lang.Integer cannot be cast to java.lang.String at demo01.Demo01Test.main(Demo01Test.java:24)
        //数据类型安全问题。
//        String y = (String) point4.getY();
    }
}
